<?php
if (!empty($actionPoll)){
    $questions = $actionPoll['ActionPollsQuestion'];
    $actionPoll = $actionPoll['ActionPoll'];
    ?>
    <h2> Réponse au Sondage : <?php echo $this->Display->getText($actionPoll, 'ActionPoll');?></h2>
    
    <?php
    echo $this->Form->create('');
    
    foreach ($questions as $question){
        $questionId = $question['id'];
        echo $this->Form->input('ActionPollsQuestion.'.$questionId, array(
            'options' => $question['ActionPollsChoice'],
            'type' => 'radio',
            'legend' => $question['name'],
            'checked' => 1
        ));
        
    }
    ?>
<?php

    echo $this->Form->submit('Voter');
    echo $this->Form->end();
}
?>